<?php
/**
 * Created by PhpStorm.
 * User: mt
 * Date: 2018/10/13
 * Time: 16:24
 */

namespace App\Admin\Extensions\Tools;
use Encore\Admin\Admin;
use Encore\Admin\Grid\Tools\AbstractTool;
use Illuminate\Support\Facades\Request;


class ScanList extends AbstractTool
{
    protected function script()
    {


        return <<<EOT
$('#scan-list').on('click', function () {
    $.post('/api/scanlist');
    toastr.warning('正在识别,请稍后...', '');
});


EOT;
    }

    public function render()
    {
        Admin::script($this->script());

        return "<button class='btn btn-sm btn-success' id='scan-list'>批量识别</button>";

    }
}